<?php
	class SystemDelegations extends Model
	{
		var $database_config = 'db_config_default';
		public $name = 'system_delegations';
		public $table_name = 't_system_delegations';
		public $stored_procedure_list_paged = 'sp_system_delegations_list_paged';
		public $stored_procedure_update = 'sp_system_delegations_update';
		public $stored_procedure_get = 'sp_system_delegations_get';
		public $stored_procedure_delete = 'sp_system_delegations_delete';
		public $stored_procedure_insert = 'sp_system_delegations_insert';
		public $db_structure = array
		(
			'id' => array			
			(
				'name' => 'system_delegation_id', 
				'type'=>'bigint',
				'primary_key'=>true,
				'not_null'=>true
			),
			
			'type' => array			
			(
				'name' => 'type', 
				'type'=>'bit',
				'not_null'=>false
			),	

			'role_id' => array			
			(
				'name' => 'role_id', 
				'type'=>'varchar',
				'length'=>'100',
				'table_name'=>'t_system_delegations_roles',
				'not_null'=>false,
			),
			
			'user_id_from' => array			
			(
				'name' => 'user_id_from', 
				'type'=>'bigint',
				'not_null'=>true
			),
			
			'user_id_to' => array			
			(
				'name' => 'user_id_to', 
				'type'=>'bigint',
				'not_null'=>true
			),			
			
			'user_login_from' => array			
			(
				'name' => 'user_login_from', 
				'type'=>'varchar',
				'length'=>'50',
				'not_null'=>true
			),
			
			'user_login_to' => array			
			(
				'name' => 'user_login_to', 
				'type'=>'varchar',
				'length'=>'50',
				'not_null'=>true
			),	
			
			'url' => array			
			(
				'name' => 'system_delegation_url', 
				'type'=>'varchar',
				'length'=>'100',
				'not_null'=>false
			),	
			
			'datetime_from' => array			
			(
				'name' => 'delegation_datetime_from', 
				'type'=>'datetime',
				'not_null'=>true
			),
			
			'datetime_to' => array			
			(
				'name' => 'delegation_datetime_to', 
				'type'=>'datetime',
				'not_null'=>true
			),	
			
			'datetime_from_to' => array			
			(
				'name' => 'delegation_datetime_from_to', 
				'type'=>'datetime',
				'not_null'=>true
			),
			
			'datetime_to_to' => array			
			(
				'name' => 'delegation_datetime_to_to', 
				'type'=>'datetime',
				'not_null'=>true
			),
				
			'datetime_from_until' => array			
			(
				'name' => 'delegation_datetime_from_until', 
				'type'=>'datetime',
				'not_null'=>true
			),
			
			'datetime_to_until' => array			
			(
				'name' => 'delegation_datetime_to_until', 
				'type'=>'datetime',
				'not_null'=>true
			),			
					
		);
	}
?>